package practice;

import java.util.Scanner;

/**
 * @ClassName Switch
 * @Date 2024/11/24 10:57 04
 * @Author Jack Chen
 * @Description api-test-REST-Assured
 * @Version 1.0
 */

public class Switch {
    enum DayOfWeek {
        MONDAY,
        TUESDAY,
        WEDNESDAY,
        THURSDAY,
        FRIDAY,
        SATURDAY,
        SUNDAY
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
//        print1234(in);
//        getString(in);
//        getDay(in);
//        getWeekday(in);
        System.out.println(getDayOfWeek(in));
    }

    private static String getDayOfWeek(Scanner in) {
        DayOfWeek day = DayOfWeek.valueOf(in.next());
        String dayName = switch (day) {
            case MONDAY -> "Monday";
            case TUESDAY -> "Tuesday";
            case WEDNESDAY -> "Wednesday";
            case THURSDAY -> "Thursday";
            case FRIDAY -> "Friday";
            case SATURDAY -> "Saturday";
            case SUNDAY -> "Sunday";
        };
        return dayName;
    }

    private static void getWeekday(Scanner in) {
        System.out.println("Enter the day of the week");
        int day = in.nextInt();
        int returnInt = switch (day) {
            case 1,2,3,4,5 -> {
                System.out.println("weekday");
                yield 1;
            }
            case 6,7 -> {System.out.println("weekend"); yield 2;}
            default -> {System.out.println("invalid day");yield 3;}
        };
    }

    private static void getDay(Scanner in) {
        System.out.println("Enter the day of week");
        int day = in.nextInt();
        switch (day) {
            case 7 -> System.out.println("Sunday");
            case 1 -> System.out.println("Monday");
            case 2 -> System.out.println("Tuesday");
            case 3 -> System.out.println("Wednesday");
            case 4 -> System.out.println("Thursday");
            case 5 -> System.out.println("Friday");
            case 6 -> System.out.println("Saturday");
            default -> System.out.println("Invalid day");
        }
    }

    private static void getString(Scanner in) {
        System.out.println("Enter a string: ");
        String input = in.nextLine();
        switch (input.toLowerCase()) {
            case "yes", "y" -> System.out.println("yes");
            case "no", "n" -> System.out.println("no");
            default -> System.out.println("bad input");
        }
    }

    private static void print1234(Scanner in) {
        for (int i = 0; i < 10; i++) {
            System.out.println("Select option: (1, 2, 3, 4)");
            int choice = in.nextInt();
            switch (choice) {
                case 1 -> System.out.println("1");
                case 2 -> System.out.println("2");
                case 3 -> System.out.println("3");
                case 4 -> System.out.println("4");
                default -> System.out.println("Bad input");
            }
        }
    }
}
